<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateNwYbzRdsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('nw_ybz_rds', function (Blueprint $table) {
            $table->id(); // 主键
            $table->string('name')->comment('名称');
            $table->string('resource_type')->comment('资源类型');
            $table->string('region')->comment('区域');
            $table->string('resource_set_id')->nullable()->comment('所属资源集');
            $table->string('vdc_id')->nullable()->comment('所属VDC');
            $table->string('created_at_utc')->comment('创建时间(UTC+08:00)');
            $table->string('rds_id')->nullable()->comment('rds_id');
            $table->string('order_number')->nullable()->comment('申请订单号');
            $table->string('resource_group')->nullable()->comment('所属资源组');
            $table->string('vpc_id')->nullable()->comment('虚拟私有云ID');
            $table->string('disk_size')->nullable()->comment('磁盘大小');
            $table->string('disk_type')->nullable()->comment('磁盘类型');
            $table->string('specification')->nullable()->comment('规格');
            $table->string('instance_ip')->nullable()->comment('实例IP');
            $table->string('status')->nullable()->comment('状态');
            $table->string('elastic_ip')->nullable()->comment('弹性IP');
            $table->string('security_group_id')->nullable()->comment('安全组ID');
            $table->string('port')->nullable()->comment('端口');
            $table->string('subnet_id')->nullable()->comment('子网ID');
            $table->string('instance_type')->nullable()->comment('实例类型');
            $table->string('engine_version')->nullable()->comment('引擎版本');
            $table->string('engine_type')->nullable()->comment('引擎类型');

            // 如果有外键关系，可以在这里定义，例如：
            // $table->foreign('resource_set_id')->references('id')->on('resource_sets');
            // $table->foreign('vdc_id')->references('id')->on('vdc_table');
            // 请根据实际情况调整表名
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('nw_ybz_rds');
    }
}
